package com.njcs.barcode;

import java.io.*;
import com.org.barcode.*;
import com.org.barcode.encoder.*;

class CODE128GIF {
	public static void main(String[] args) {

		// Get the data to encode in barcode
		String message = null;
		BufferedReader in = new BufferedReader(
				new InputStreamReader(System.in), 1);
		System.out.print("Codigo de barras a generar: ");

		try {
			message = in.readLine();
			if (message == null)
				return; // All done on EOF, so just exit.
		} catch (IOException e) {
			System.out.println("\n\n*** Exception caught: " + e);
			return;
		}

		// NOTE: "BarCode" is the class of the linear barcode encoder

		BarCode bc = new BarCode();

		// set the data to encode
		bc.code = message;

		// select the barcode symbology
		bc.barType = bc.CODE128;

		// Size of barCode
		bc.resolution = 38;

		// bc.rotate=90;

		// create the file as the name of the message
		barCodeEncoder bce = new barCodeEncoder(bc, "GIF", "GENERATOR"
				+ message + ".gif");
		System.exit(0);
	}

}
